package Vue;
import java.awt.GridLayout;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

import Modele.MonteCarloSimulationMulti;


public class FenetreModifierMulti extends JFrame {


	private JTextField jtf1;
	private JTextField jtf2;
	private JTextField jtf3;
	private JTextField jtf4;
	private JTextField jtf5;
	private JTextField jtf6;
	private JTextField jtf7;
	private JTextField jtf8;
	
	private JButton b = new JButton("Lancer la simulation");
	private JButton cancel=new JButton("Annuler");
	
	
	private JLabel JL1 = new JLabel("   Prix de l'action:");
	private JLabel JL2 = new JLabel("   Strike price:");
	private JLabel JL3 = new JLabel("   Taux d'interet:");
	private JLabel JL4 = new JLabel("   Temps restant echeance:");
	private JLabel JL5 = new JLabel("   Taux des frais de détention:");
	private JLabel JL6 = new JLabel("   Volatilité:");
	private JLabel JL7 = new JLabel("   nSteps:");
	private JLabel JL8 = new JLabel("   nSimulations:");
	
	private MonteCarloSimulationMulti mcs= new  MonteCarloSimulationMulti();
	
	public FenetreModifierMulti(){
		
		jtf1 = new JTextField(Double.toString(mcs.getS()));
		jtf2 = new JTextField(Double.toString(mcs.getX()));
		jtf3 = new JTextField(Double.toString(mcs.getR()));
		jtf4 = new JTextField(Double.toString(mcs.getT()));
		jtf5 = new JTextField(Double.toString(mcs.getB()));
		jtf6 = new JTextField(Double.toString(mcs.getV()));
		jtf7 = new JTextField(Integer.toString(mcs.getnSteps()));
		jtf8 = new JTextField(Integer.toString(mcs.getnSimulations()));
		
		JPanel pan = new JPanel(new GridLayout(9, 1));
		pan.add(JL1);
		pan.add(jtf1);
		pan.add(JL2);
		pan.add(jtf2);
		pan.add(JL3);
		pan.add(jtf3);
		pan.add(JL4);
		pan.add(jtf4);
		pan.add(JL5);
		pan.add(jtf5);
		pan.add(JL6);
		pan.add(jtf6);
		pan.add(JL7);
		pan.add(jtf7);
		pan.add(JL8);
		pan.add(jtf8);
		pan.add(b);
		pan.add(cancel);
		
		this.setBounds(0, 0, 300, 350);
		this.setLocationRelativeTo(null);
		this.setTitle("Modifier valeur par default");
		this.setContentPane(pan);
			
	}
	
	
	public JTextField getJtf1() {
		return jtf1;
	}

	public void setJtf1(JTextField jtf1) {
		this.jtf1 = jtf1;
	}

	public JTextField getJtf2() {
		return jtf2;
	}

	public void setJtf2(JTextField jtf2) {
		this.jtf2 = jtf2;
	}

	public JTextField getJtf3() {
		return jtf3;
	}

	public void setJtf3(JTextField jtf3) {
		this.jtf3 = jtf3;
	}

	public JTextField getJtf4() {
		return jtf4;
	}

	public void setJtf4(JTextField jtf4) {
		this.jtf4 = jtf4;
	}

	public JTextField getJtf5() {
		return jtf5;
	}

	public void setJtf5(JTextField jtf5) {
		this.jtf5 = jtf5;
	}

	public JTextField getJtf6() {
		return jtf6;
	}

	public void setJtf6(JTextField jtf6) {
		this.jtf6 = jtf6;
	}

	public JTextField getJtf7() {
		return jtf7;
	}

	public void setJtf7(JTextField jtf7) {
		this.jtf7 = jtf7;
	}

	public JTextField getJtf8() {
		return jtf8;
	}

	public void setJtf8(JTextField jtf8) {
		this.jtf8 = jtf8;
	}
	
	public void modifierValeurListener(ActionListener listenForOKButton){
		b.addActionListener(listenForOKButton);
	}
	
	public void cancelListener(ActionListener listenForOKButton){
		cancel.addActionListener(listenForOKButton);
	}

}
